home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / dskut / decode10.zip / DBASE4.RUL < prev    next >
Text File  |  1992-12-07  |  3KB  |  117 lines

  1. ############################################################################
  2. #                                                                          #
  3. # dbase4.rul -- Decode It! rule file for dBASE IV DBF files                #
  4. #               (dBASE is a registered trademark of Borland International) #
  5. #                                                                          #
  6. # Please note: This rule file is provided as an example only.  While       #
  7. #              every effort has been made to validate the information      #
  8. #              presented here, Axiom Innovations takes no responsibility   #
  9. #              for the integrity of the data that results from using       #
  10. #              this example.                                               #
  11. #                                                                          #
  12. ############################################################################
  13.  
  14. # dBASE IV Header area
  15. RECORD  Header
  16.  
  17.   # Bits 0-2:  dBase version number
  18.   # Bits 3-5:  Reserved for SQL
  19.   # Bits 6-7:  Availability of a memo file
  20.   XTINY  Version
  21.  
  22.   # Year of last edit date
  23.   TINY   Year
  24.  
  25.   # Month of last edit date
  26.   TINY   Month
  27.  
  28.   # Day of last edit date
  29.   TINY   Day
  30.  
  31.   # Number of records in the database
  32.   LONG   Record_Number
  33.  
  34.   # Length of header area
  35.   SHORT  Header_Length
  36.  
  37.   # Record size in bytes
  38.   SHORT  Record_Size
  39.  
  40.   SHORT  Reserved1
  41.  
  42.   # Aborted transaction
  43.   XTINY  Aborted_Xact
  44.  
  45.   # Contents encoded
  46.   XTINY  Encoded_Contents
  47.  
  48.   # Reserved for LAN use
  49.   XTINY  Reserved2  12
  50.   (OMIT0)  Header.Reserved2
  51.  
  52.   # Reserved
  53.   XTINY   Reserved3  4
  54.   (OMIT0) Header.Reserved3
  55.  
  56. END
  57.  
  58.  
  59. # Field definitions
  60. WHILE  .OFFSET  <  Header.Header_Length
  61.   RECORD  Field  -1
  62.  
  63.     # Field name, left justified, zero-filled
  64.     WHILE  Field.Name  <>  13
  65.       ASCII  Name  11
  66.     (OMIT0)  Field.Name
  67.  
  68.     # CR is the End of Fields marker
  69.     WHILE  Field.Name  <=>  13
  70.       BREAK
  71.  
  72.     # Field type: C, N, L, D, F, or M
  73.     ASCII   Type
  74.   
  75.     XLONG   Reserved1
  76.  
  77.     # Field length
  78.     TINY    Length 
  79.  
  80.     # Number of decimals
  81.     TINY    Decimal_Digits
  82.  
  83.     XSHORT  Reserved2
  84.  
  85.     # Work area ID
  86.     XTINY   Work_Id
  87.  
  88.     # Reserved
  89.     TINY    Reserved  11
  90.     (OMIT0)  Field.Reserved
  91.  
  92.   END
  93.  
  94.  
  95. WHILE  .OFFSET  <  Header.Header_Length
  96.   TINY unused -1
  97. (OMIT0) unused
  98.  
  99. # Actual database
  100. RECORD  DBASE4_Record  Header.Record_Number
  101.  
  102.   # Deleted records contain an asterisk ('*') in first byte
  103.   # Normal records contain a space in first byte
  104.   ASCII  Deleted_Flag
  105.  
  106.   ASCII  Info  -1
  107.  
  108. END  Header.Record_Size
  109.  
  110.  
  111. # End of file
  112. TINY  EndOfFile
  113.  
  114.  
  115. EXIT
  116.  
  117.